package com.example.mapper;

import com.example.entity.College;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CollegeMapper {
    List<College> selectAll(College college);

    @Insert("insert into college (college_name) values (#{collegeName}) ")
    void insert(College college);

    @Update("update college set college_name=#{collegeName} where college_id=#{collegeId}")
    void update(College college);

    @Delete("delete from college where college_id=#{collegeId}")
    void delete(Integer collegeId);

    @Select("select count(*) from college where college_name = #{collegeName}")
    int countByCollegeName(String collegeName);

    @Select("select * from college where college_id=#{collegeId}")
    College selectById(Integer collegeId);
}
